Repository navigation
fix(wikipedia): recognize long language subdomains - #2598
LeonSGP (LeonSGP43) wants to merge 1 commit into
Conversation
|
LeonSGP (@LeonSGP43) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
Thanks for handling the longer Wikipedia language subdomains. One related hostname-case test may be useful: in a network-isolated test of the public converter with synthetic HTML and an explicit I reconstructed and hash-verified this PR’s converter file at |
Summary
Wikipedia language domains such as
simple.wikipedia.organdbe-tarask.wikipedia.orgwere rejected by the converter's two-to-three-character language match. They then used generic HTML conversion, adding navigation content to article Markdown. Accept longer and hyphenated language codes for desktop and mobile domains while matching the hostname's literal dots.This is a focused follow-up to the Wikipedia language-domain fix discussed in #1723. The maintainer requested separating that mixed submission into focused PRs; the issue is still present on the current target branch.
Verification
Python 3.12.8:
python -m pytest packages/markitdown/tests/test_html.py -q: 46 passed (2.75s).Same added tests against the unchanged target branch: 9 failed, 37 passed (3.35s); English controls continue to pass.
GITHUB_ACTIONS=1 PYTHONUTF8=1 UV_CONSTRAINT="$PWD/../../.github/constraints.txt" hatch test --python 3.12frompackages/markitdown(exit 0): 1052 passed, 55 skipped (90.71s). The CI flag disables remote test vectors; ExifTool and optional integration coverage are also explicitly skipped by the tests.Additional local core suite: 1095 passed, 12 skipped (225.32s).
pre-commit run --all-files,python -m compileall -q packages/markitdown/src/markitdown/converters/_wikipedia_converter.py, andgit diff --checkeach exit 0.Additional local package checks:
python -m pytest packages/markitdown-ocr/tests -q(108 passed, 95.62s, exit 0) andpython -m pytest packages/markitdown-mcp/tests -q(21 passed, 15.14s, exit 0), with locally installed core/OCR/MCP packages and CI environment flags. These are local package tests, not live Vision or deployed MCP validation.Validation was run locally on macOS with Python 3.12.8. The other CI Python versions and Windows/Linux matrix were not run locally.
AI assistance: OpenAI Codex assisted with investigation, implementation and verification. All new regression fixtures use the real local conversion API; they do not fetch Wikipedia or call a model service.